// import { defineStore } from "@/pinia"; // 自己
import { defineStore } from "pinia"; // 官方

import { ref, computed } from "vue";

// composition API

export const useCounterStore2 = defineStore("counter2", () => {
    const count = ref(10);

    const increment = (payload = 3) => {
        count.value *= payload;
    };

    const double = computed(() => {
        return count.value * 2;
    });

    return { count, increment, double };
});
